package kr.hkit.Powerjava.chapter24.work3.vo;

import java.io.Serializable;

public class Department2 implements Serializable,Comparable<Department2>{

	private int depNo;
	private String depName;
	private int floor;
	
	
	
	public Department2(int depNo, String depName) {
		super();
		this.depNo = depNo;
		this.depName = depName;
	}
	public Department2(int depNo, String depName, int floor) {
		super();
		this.depNo = depNo;
		this.depName = depName;
		this.floor = floor;
	}

	public int getDepNo() {
		return depNo;
	}
	public void setDepNo(int depNo) {
		this.depNo = depNo;
	}
	public String getDepName() {
		return depName;
	}
	public void setDepName(String depName) {
		this.depName = depName;
	}
	public int getFloor() {
		return floor;
	}
	public void setFloor(int floor) {
		this.floor = floor;
	}
	
	
	@Override
	public String toString() {
		return String.format("%s\t%s\t%s]",
				depNo, depName, floor);
	}
	@Override
	public int compareTo(Department2 o) {
		return depNo-o.depNo;
	}
	@Override
	public boolean equals(Object obj) {
		if(obj instanceof Department2){
			Department2 temp = (Department2)obj;
			return depNo==temp.depNo && depName.equals(temp.depName);
		}else{
			return false;
		}
	}
	
}
